#include "bits/stdc++.h"

using namespace std;

typedef long long ll;

const int N = 10;
ll positive[N], negative[N];
int a[N];

int main()
{
    int n;
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];

    if (a[1] > 0)
        positive[1] = 1;
    else
        negative[1] = 1;

    for (int i = 2; i <= n; i++)
    {
        if (a[i] > 0)
        {
            positive[i] = positive[i - 1] + 1;
            negative[i] = negative[i - 1];
        }
        else
        {
            positive[i] = negative[i - 1];
            negative[i] = positive[i - 1] + 1;
        }
    }

    ll res = 0;
    for (int i = 1; i <= n; i++)
        res += negative[i];
    cout << res << " " << n * (n + 1) / 2 - res << endl;
    return 0;
}